feat: Surfacing heartbeat counts for activities#10020
feat: Surfacing heartbeat counts for activities#10020davidporter-id-au merged 17 commits intotemporalio:mainfrom
Conversation
|
This probably needs some more tests too, I'm just putting it in draft for early feedback |
| require.True(t, hbResp.CancelRequested) | ||
| }) | ||
|
|
||
| t.Run("HeartbeatDetailsAvailableOnRetry", func(t *testing.T) { |
There was a problem hiding this comment.
can you extend this test so that we're counting the heartbeats across retries? You have one that validates multiple heartbeats but this scenario checks it across retries.
It'd be Poll1 -> Heartbeat1 -> Fail1 -> Poll2 -> Heartbeat2 -> Complete2 -> Describe (assert count=2)
There was a problem hiding this comment.
Good call, let me add
| }) | ||
| require.NoError(t, err) | ||
|
|
||
| require.Equal(t, int64(2), desc.Info.GetTotalHeartbeatCount(), "total heartbeat count") |
There was a problem hiding this comment.
nit: Wwe use the proto getters for better safety in general, though doesn't really matter here as it's always nonnil
| require.Equal(t, int64(2), desc.Info.GetTotalHeartbeatCount(), "total heartbeat count") | |
| require.Equal(t, int64(2), desc.GetInfo().GetTotalHeartbeatCount(), "total heartbeat count") |
| "go.temporal.io/server/api/historyservice/v1" | ||
| "go.temporal.io/server/chasm" | ||
| "go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1" | ||
| activitypb "go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1" |
There was a problem hiding this comment.
huh, I didn't know goimports supported that
| desc, err := s.FrontendClient().DescribeActivityExecution(ctx, &workflowservice.DescribeActivityExecutionRequest{ | ||
| Namespace: s.Namespace().String(), | ||
| ActivityId: activityID, | ||
| IncludeOutcome: true, |
There was a problem hiding this comment.
nit: not needed for this test
## What changed? This is some fast-follow feedback items for the PR #10020. ## Why? Automerge landed the changes before I could respond, so just adding these followup items here. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks small test changes only, very low risk
What changed?
This surfaces the total count of received activities by the server-side (noting that they'll be throttled client-side under frequent heartbeating scenarios, so this is likely to be an undercount of the user calls to activity.RecordHeartbeat).
This should be a field visible for the DescribeActivityInfo call.
Why?
UX improvement for users
How did you test it?
Potential risks
None identified yet